<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>选择来往单位</title>
    <jsp:include page="/WEB-INF/view/commons/css.jsp" />
</head>
<body >
<div id="main-container" class="container-fluid">
    <form  action="appMaterialsOut/${action eq "create" ?"save":"update"}" name="inputForm" id="inputForm" method="post" class="form-horizontal">
        <input name="id" id="id" value="${entity.id}" type="hidden" />
        <div class="row">
            <div class="radio col-sm-3">
                <label>
                    <input type="radio" class="ace">
                    <span class="lbl">内部单位</span>
                </label>
            </div>
            <div class="radio col-sm-3">
                <label>
                    <input type="radio" class="ace">
                    <span class="lbl">外部单位</span>
                </label>
            </div>
        </div>
        <div class="row mt20">
            <div class="col-sm-5">
                <div class="input-group">
                    <input class="form-control" placeholder="请输入名称关键字">
                    <span class="input-group-btn"><button type="button" class="btn btn-primary btn-sm">查询</button></span>
                </div>
            </div>
        </div>
        <table class="table table-striped table-bordered mt20">
            <thead>
            <th><input type="checkbox"></th>
            <th>编号</th>
            <th>单位名称</th>
            <th>联系人</th>
            <th>联系电话</th>
            </thead>
        </table>
    </form>
</div><!--/#main-container-->

<!-- script start -->
<jsp:include page="/WEB-INF/view/commons/js.jsp" />
<script type="text/javascript">
    $(document).ready(function(e) {
        var options = {
            rules:{
                outCode : { required : true, maxlength : 50 },
                outTitle : { required : true, maxlength : 100 },
                orgName : { required : true, maxlength : 100 },
                orgId : { required : true, digits : true  },
                grantOrgName : { required : true, maxlength : 50 },
                grantOrgId : { required : true, digits : true  },
                agentName : { required : true, maxlength : 50 },
                actionTime : { required : true },
                outTime : { required : true },
                outStatus : { required : true, maxlength : 2 }
            },
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        if(data.success){
                            $('#searchBtn', parent.document).click();
                            closeIframe();
                        }else{
                            layer.alert(data.msg);
                        }
                    }
                });
            }
        };
        $("#inputForm").validate(options);
    });
</script>
<!-- script end -->
</body>
</html>
